Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / component / MeshtasticAppShell.kt

Displaying Raw • Download

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/MeshtasticAppShell.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 3.67 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.component

Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.CompositionLocalProvider
Tff7b72import T7ee787androidx.compose.runtime.LaunchedEffect
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.compose.runtime.remember
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787kotlinx.coroutines.flow.distinctUntilChanged
Tff7b72import T7ee787kotlinx.coroutines.flow.map
Tff7b72import T7ee787org.koin.compose.koinInject
Tff7b72import T7ee787org.meshtastic.core.navigation.MultiBackstack
Tff7b72import T7ee787org.meshtastic.core.navigation.NodeDetailRoute
Tff7b72import T7ee787org.meshtastic.core.navigation.NodesRoute
Tff7b72import T7ee787org.meshtastic.core.repository.RadioConfigRepository
Tff7b72import T7ee787org.meshtastic.core.ui.util.LocalMeshActivity
Tff7b72import T7ee787org.meshtastic.core.ui.util.LocalModemPreset
Tff7b72import T7ee787org.meshtastic.core.ui.viewmodel.UIViewModel

T8b949e/**
* Shared shell for setting up global UI logic across platforms (Android, Desktop).
*
* This component handles deep linking, shared dialogs (via [MeshtasticCommonAppSetup]), and provides the global
* [MeshtasticSnackbarProvider]. Platform entry points should wrap their navigation layout inside this shell.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffMeshtasticAppShellTb4b4b4(
Te6edf3multiBackstackTb4b4b4: Te6edf3MultiBackstackTb4b4b4,
Te6edf3uiViewModelTb4b4b4: Te6edf3UIViewModelTb4b4b4,
Te6edf3hostModifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Te6edf3contentTb4b4b4: Tf0883e@Composable Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3LaunchedEffectTb4b4b4(Te6edf3uiViewModelTb4b4b4) Tb4b4b4{
Te6edf3uiViewModelTb4b4b4.Te6edf3navigationDeepLinkTb4b4b4.Te6edf3collect Tb4b4b4{ Te6edf3navKeys Tff7b72-Tff7b72> Te6edf3multiBackstackTb4b4b4.Te6edf3handleDeepLinkTb4b4b4(Te6edf3navKeysTb4b4b4) Tb4b4b4}
Tb4b4b4}

Te6edf3MeshtasticCommonAppSetupTb4b4b4(
Te6edf3uiViewModel Tff7b72= Te6edf3uiViewModelTb4b4b4,
Te6edf3onNavigateToTracerouteMap Tff7b72= Tb4b4b4{ Te6edf3destNumTb4b4b4, Te6edf3requestIdTb4b4b4, Te6edf3logUuid Tff7b72-Tff7b72>
Te6edf3multiBackstackTb4b4b4.Te6edf3handleDeepLinkTb4b4b4(
Te6edf3listOfTb4b4b4(
Te6edf3NodesRouteTb4b4b4.Te6edf3NodesTb4b4b4,
Te6edf3NodeDetailRouteTb4b4b4.Te6edf3TracerouteMapTb4b4b4(Te6edf3destNum Tff7b72= Te6edf3destNumTb4b4b4, Te6edf3requestId Tff7b72= Te6edf3requestIdTb4b4b4, Te6edf3logUuid Tff7b72= Te6edf3logUuidTb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)

T8b949e// Connected device's modem preset, provided once here so signal-quality rating is preset-relative across all
T8b949e// screens without per-screen plumbing. Distinct so the value only changes when the preset itself does.
Tff7b72val Te6edf3radioConfigRepository Tff7b72= Te6edf3koinInjectTff7b72<Te6edf3RadioConfigRepositoryTff7b72>Tb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3modemPreset Tff7b72by
Te6edf3rememberTb4b4b4(Te6edf3radioConfigRepositoryTb4b4b4) Tb4b4b4{
Te6edf3radioConfigRepositoryTb4b4b4.Te6edf3localConfigFlowTb4b4b4.Te6edf3map Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3loraTff7b72?.Te6edf3modem_preset Tb4b4b4}Tb4b4b4.Te6edf3distinctUntilChangedTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Te6edf3initialValue Tff7b72= Tff7b72nullTb4b4b4)

Te6edf3MeshtasticSnackbarProviderTb4b4b4(Te6edf3snackbarManager Tff7b72= Te6edf3uiViewModelTb4b4b4.Te6edf3snackbarManagerTb4b4b4, Te6edf3hostModifier Tff7b72= Te6edf3hostModifierTb4b4b4) Tb4b4b4{
T8b949e// Provide the activity FLOW (stable ref) — not a collected value — so it costs no recomposition; only the
T8b949e// local-node connection badge collects it, animating in the draw phase. See LocalMeshActivity.
Te6edf3CompositionLocalProviderTb4b4b4(
Te6edf3LocalModemPreset Te6edf3provides Te6edf3modemPresetTb4b4b4,
Te6edf3LocalMeshActivity Te6edf3provides Te6edf3uiViewModelTb4b4b4.Te6edf3meshActivityTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3contentTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.05s